package com.gao.api.gate.quick.proto.point;

import com.gao.api.gate.quick.core.async.ListenableFuture;
import com.gao.api.gate.quick.core.service.Service;
import com.gao.api.gate.quick.proto.http.Request;
import com.gao.api.gate.quick.proto.http.RequestContext;
import com.gao.api.gate.quick.proto.http.Response;

import java.io.Closeable;
import java.util.concurrent.ExecutorService;

/**
 * <p>
 *     端与端的操作
 * </p>
 *
 * @author gaoshuangwen
 * @since 2022/01/17 20:17
 */
public interface Endpoint<E extends Endpoint<?,?>,C extends EndpointConfig> extends Closeable {

    E open(C config);

    Flow transfer(Endpoint<?,?> target, RequestContext context,Flow flow);

    void connect(Endpoint<?,?> target);

    boolean isRunning();

    EndpointHandler getHandler();

    ExecutorService loop();



}
